########################### Ultimate image ############################
FROM registry.cn-hangzhou.aliyuncs.com/jinquan711/alpine:3.16-jq-build19

##-> image's description & author
MAINTAINER jinquan jinquan7@foxmail.com
LABEL Description="Solar system web application demo."

# import external [--build-arg] argument
ARG APP_ROUTINE

##-> copy executable objects to target image
COPY ./${APP_ROUTINE} /app/${APP_ROUTINE}
COPY ./assets /app/assets
COPY ./config.yaml /app/

##-> copy app's other files to target image
COPY ./cmd/version /app/

ADD devops/ci/docker/entrypoint.sh /usr/sbin/

RUN chmod +x /usr/sbin/entrypoint.sh

EXPOSE 22
EXPOSE 8000

#VOLUME [ "/app/log" ]

## set environment variables in container
ENV app_routine=$APP_ROUTINE

## start applications
ENTRYPOINT ["/usr/sbin/entrypoint.sh"]
